<template>
  <el-container class="el-container--privilege">
    <el-container>
      <el-main>
        <vxe-table :loading="dataListLoading" :data="dataList" highlight-current-row ref="xTable" auto-resize
          remote-sort @sort-change="dataListSortChangeHandle" class="vxe-table-element">
          <vxe-table-column type="index" width="50" fixed="left" align="center"></vxe-table-column>
          <vxe-table-column field="username" title="user.username" sortable>
            <template slot-scope="scope">
              <span>{{ scope.row.realName }}({{ scope.row.username }})</span>
              <i v-if="scope.row.superAdmin.toString() == '2'" class="icon_user_admin">
                <el-tag type="success" size="mini" effect="dark">管理员</el-tag>
              </i>
              <i v-if="scope.row.superAdmin.toString() == '1'" class="el-icon-bell icon_user_admin">
              </i>
            </template>
          </vxe-table-column>
          <vxe-table-column field="deptId" title="user.deptName" sortable align="center">
            <template slot-scope="scope" align="center">
              <span>{{ scope.row.deptName }}</span>
            </template>
          </vxe-table-column>
          <!-- <vxe-table-column field="mobile" title="user.mobile" width="120" align="center"></vxe-table-column> -->
          <vxe-table-column field="roleName" title="角色" align="left" header-align="center"></vxe-table-column>
        </vxe-table>
        <el-pagination :current-page="page" :page-sizes="[5, 10, 20, 50, 100]" :page-size="limit" :total="total" layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle" @current-change="pageCurrentChangeHandle">
        </el-pagination>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
// import { isEmpty } from '@/utils/validate'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        activatedIsNeed: false, // 此页面是否在激活（进入）时，调用查询数据列表接口？
        getDataListURL: '/sys/user/page',
        getDataListIsPage: true
      },
      dataForm: {
        hasRole: true
      }
    }
  },
  props: {},
  methods: {
    init () {
      this.$nextTick(() => {
        Promise.all([
        ]).then(() => {
        })
      })
    }
  }
}
</script>
